#ifndef __IOFILEDISK_H__
#define __IOFILEDISK_H__

#include "IOFile.h"
#include "FileSystem.h"

class CIOPFSFileDisk : public CIOFile
{
protected:
	FILE *FileBuffer;
public:
	CIOPFSFileDisk(stringc dir,stringc filename,CFileSystem *fsp);
	virtual ~CIOPFSFileDisk(void);

	virtual u32 CopyFromFileToMemory(u32 Size);
	virtual IIOFile *CreateBinaryFile(stringc Name);
	virtual bool OpenFileForWriting(stringc Name);
	virtual u32 WriteBinary(void *Buffer,u32 Size);
	virtual bool CloseFile();

	virtual bool FindFirst(stringc Path,FindDataStrc *fdata);
	virtual bool FindNext(FindDataStrc *fdata);
	virtual bool FindClose();
	virtual bool IsSubDir(FindDataStrc *fdata);
	virtual bool ReadFileHeader(stringc File);
	virtual bool IsSubString(stringc Str,stringc Inside,int &Begin);
	virtual bool SeparatePFSFileElements(stringc Dir,stringc &PFSFileOnDisk,stringc &PFSFilePath,stringc &PFSFileName);
	virtual bool ReadFilePointerByIndex(stringc PFSFile,stringc RelativePathInPFS,stringc FileInPFS,u32 Index,FindDataStrc *fdata);

	virtual s32 FRead(void *Buffer,u32 Size,void *BufferFrom);
	virtual s32 FClose(void *BufferToClose);
	virtual s32 FSeek(void *Buffer,u32 PositionToSeek);
	virtual void *FOpenReadBinary(stringc FileToOpen);

};

#endif
